package com.spark.lola.logistics.mapper;

import com.spark.lola.logistics.entity.ExpensesDetail;
import com.spark.lola.support.mybatis.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author: Zhi-peng wang
 * @date: 2020/05/07 10:48
 **/
@Mapper
public interface ExpensesDetailMapper extends BaseMapper<ExpensesDetail> {

    @Select("select id from logistics_expenses_detail where expenses_id=#{expensesInfoId}")
    List<Long> findIdByExpensesInfoId(long expensesInfoId);

    @Select("select * from logistics_expenses_detail where expenses_id=#{expensesId}")
    List<ExpensesDetail> findByExpensesId(long expensesId);

    @Delete("delete from logistics_expenses_detail where expenses_id=#{expensesId}")
    int deleteByExpensesId(long expensesId);

}
